package com.fit.entities.sport;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.tapestry5.beaneditor.NonVisual;

import com.fit.entities.shedule.Shedule;
import com.fit.entities.training.Training;

@Entity
@Table(name="sport")
public class Sport {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@NonVisual
	@Column(name="sport_id")
	private Long sportId;
	
	
	 @Column(name="type", nullable=false)
	 private double type;
	
	
	 @Column(name="name", nullable=false)
	 private String name;

	 @OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.sport")
		private List<Training> trainings = new LinkedList<Training>();
	 
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.sport")
	private List<Shedule> shedules = new LinkedList<Shedule>();

	public Long getSportId() {
		return sportId;
	}


	public void setSportId(Long sportId) {
		this.sportId = sportId;
	}


	public double getType() {
		return type;
	}


	public void setType(double type) {
		this.type = type;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public List<Training> getTrainings() {
		return trainings;
	}


	public void setTrainings(List<Training> trainings) {
		this.trainings = trainings;
	}


	public List<Shedule> getShedules() {
		return shedules;
	}


	public void setShedules(List<Shedule> shedules) {
		this.shedules = shedules;
	}
	 
	
}
